{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n",
      "C:\\Users\\asus\\anaconda3\\lib\\site-packages\\tensorflow\\python\\framework\\dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_qint8 = np.dtype([(\"qint8\", np.int8, 1)])\n",
      "C:\\Users\\asus\\anaconda3\\lib\\site-packages\\tensorflow\\python\\framework\\dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_quint8 = np.dtype([(\"quint8\", np.uint8, 1)])\n",
      "C:\\Users\\asus\\anaconda3\\lib\\site-packages\\tensorflow\\python\\framework\\dtypes.py:528: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_qint16 = np.dtype([(\"qint16\", np.int16, 1)])\n",
      "C:\\Users\\asus\\anaconda3\\lib\\site-packages\\tensorflow\\python\\framework\\dtypes.py:529: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_quint16 = np.dtype([(\"quint16\", np.uint16, 1)])\n",
      "C:\\Users\\asus\\anaconda3\\lib\\site-packages\\tensorflow\\python\\framework\\dtypes.py:530: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_qint32 = np.dtype([(\"qint32\", np.int32, 1)])\n",
      "C:\\Users\\asus\\anaconda3\\lib\\site-packages\\tensorflow\\python\\framework\\dtypes.py:535: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  np_resource = np.dtype([(\"resource\", np.ubyte, 1)])\n"
     ]
    }
   ],
   "source": [
    "import nltk\n",
    "from nltk.stem import WordNetLemmatizer\n",
    "lemmatizer = WordNetLemmatizer()\n",
    "import json\n",
    "import pickle\n",
    "\n",
    "import numpy as np\n",
    "from keras.models import Sequential\n",
    "from keras.layers import Dense, Activation, Dropout\n",
    "from keras.optimizers import SGD\n",
    "import random"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "words=[]\n",
    "classes = []\n",
    "documents = []\n",
    "ignore_words = ['?', '!']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "data_file = open(r'D:\\internship\\chatbot-master\\intents.json').read()\n",
    "intents = json.loads(data_file)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'intents': [{'tag': 'greeting',\n",
       "   'patterns': ['Hi there',\n",
       "    'How are you',\n",
       "    'Is anyone there?',\n",
       "    'Hey',\n",
       "    'Hola',\n",
       "    'Hello',\n",
       "    'Good day'],\n",
       "   'responses': ['Hello, thanks for asking',\n",
       "    'Good to see you again',\n",
       "    'Hi there, how can I help?'],\n",
       "   'context': ['']},\n",
       "  {'tag': 'goodbye',\n",
       "   'patterns': ['Bye',\n",
       "    'See you later',\n",
       "    'Goodbye',\n",
       "    'Nice chatting to you, bye',\n",
       "    'Till next time'],\n",
       "   'responses': ['See you!', 'Have a nice day', 'Bye! Come back again soon.'],\n",
       "   'context': ['']},\n",
       "  {'tag': 'thanks',\n",
       "   'patterns': ['Thanks',\n",
       "    'Thank you',\n",
       "    \"That's helpful\",\n",
       "    'Awesome, thanks',\n",
       "    'Thanks for helping me'],\n",
       "   'responses': ['Happy to help!', 'Any time!', 'My pleasure'],\n",
       "   'context': ['']},\n",
       "  {'tag': 'noanswer',\n",
       "   'patterns': [],\n",
       "   'responses': [\"Sorry, can't understand you\",\n",
       "    'Please give me more info',\n",
       "    'Not sure I understand'],\n",
       "   'context': ['']},\n",
       "  {'tag': 'options',\n",
       "   'patterns': ['How you could help me?',\n",
       "    'What you can do?',\n",
       "    'What help you provide?',\n",
       "    'How you can be helpful?',\n",
       "    'What support is offered'],\n",
       "   'responses': ['I can guide you through Adverse drug reaction list, Blood pressure tracking, Hospitals and Pharmacies',\n",
       "    'Offering support for Adverse drug reaction, Blood pressure, Hospitals and Pharmacies'],\n",
       "   'context': ['']},\n",
       "  {'tag': 'adverse_drug',\n",
       "   'patterns': ['How to check Adverse drug reaction?',\n",
       "    'Open adverse drugs module',\n",
       "    'Give me a list of drugs causing adverse behavior',\n",
       "    'List all drugs suitable for patient with adverse reaction',\n",
       "    'Which drugs dont have adverse reaction?'],\n",
       "   'responses': ['Navigating to Adverse drug reaction module'],\n",
       "   'context': ['']},\n",
       "  {'tag': 'blood_pressure',\n",
       "   'patterns': ['Open blood pressure module',\n",
       "    'Task related to blood pressure',\n",
       "    'Blood pressure data entry',\n",
       "    'I want to log blood pressure results',\n",
       "    'Blood pressure data management'],\n",
       "   'responses': ['Navigating to Blood Pressure module'],\n",
       "   'context': ['']},\n",
       "  {'tag': 'blood_pressure_search',\n",
       "   'patterns': ['I want to search for blood pressure result history',\n",
       "    'Blood pressure for patient',\n",
       "    'Load patient blood pressure result',\n",
       "    'Show blood pressure results for patient',\n",
       "    'Find blood pressure results by ID'],\n",
       "   'responses': ['Please provide Patient ID', 'Patient ID?'],\n",
       "   'context': ['search_blood_pressure_by_patient_id']},\n",
       "  {'tag': 'search_blood_pressure_by_patient_id',\n",
       "   'patterns': [],\n",
       "   'responses': ['Loading Blood pressure result for Patient'],\n",
       "   'context': ['']},\n",
       "  {'tag': 'pharmacy_search',\n",
       "   'patterns': ['Find me a pharmacy',\n",
       "    'Find pharmacy',\n",
       "    'List of pharmacies nearby',\n",
       "    'Locate pharmacy',\n",
       "    'Search pharmacy'],\n",
       "   'responses': ['Please provide pharmacy name'],\n",
       "   'context': ['search_pharmacy_by_name']},\n",
       "  {'tag': 'search_pharmacy_by_name',\n",
       "   'patterns': [],\n",
       "   'responses': ['Loading pharmacy details'],\n",
       "   'context': ['']},\n",
       "  {'tag': 'hospital_search',\n",
       "   'patterns': ['Lookup for hospital',\n",
       "    'Searching for hospital to transfer patient',\n",
       "    'I want to search hospital data',\n",
       "    'Hospital lookup for patient',\n",
       "    'Looking up hospital details'],\n",
       "   'responses': ['Please provide hospital name or location'],\n",
       "   'context': ['search_hospital_by_params']},\n",
       "  {'tag': 'search_hospital_by_params',\n",
       "   'patterns': [],\n",
       "   'responses': ['Please provide hospital type'],\n",
       "   'context': ['search_hospital_by_type']},\n",
       "  {'tag': 'search_hospital_by_type',\n",
       "   'patterns': [],\n",
       "   'responses': ['Loading hospital details'],\n",
       "   'context': ['']}]}"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "intents"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "for intent in intents['intents']:\n",
    "    for pattern in intent['patterns']:\n",
    "\n",
    "        #tokenize each word\n",
    "        w = nltk.word_tokenize(pattern)\n",
    "        words.extend(w)\n",
    "        #add documents in the corpus\n",
    "        documents.append((w, intent['tag']))\n",
    "\n",
    "        # add to our classes list\n",
    "        if intent['tag'] not in classes:\n",
    "            classes.append(intent['tag'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[(['Hi', 'there'], 'greeting'),\n",
       " (['How', 'are', 'you'], 'greeting'),\n",
       " (['Is', 'anyone', 'there', '?'], 'greeting'),\n",
       " (['Hey'], 'greeting'),\n",
       " (['Hola'], 'greeting'),\n",
       " (['Hello'], 'greeting'),\n",
       " (['Good', 'day'], 'greeting'),\n",
       " (['Bye'], 'goodbye'),\n",
       " (['See', 'you', 'later'], 'goodbye'),\n",
       " (['Goodbye'], 'goodbye'),\n",
       " (['Nice', 'chatting', 'to', 'you', ',', 'bye'], 'goodbye'),\n",
       " (['Till', 'next', 'time'], 'goodbye'),\n",
       " (['Thanks'], 'thanks'),\n",
       " (['Thank', 'you'], 'thanks'),\n",
       " (['That', \"'s\", 'helpful'], 'thanks'),\n",
       " (['Awesome', ',', 'thanks'], 'thanks'),\n",
       " (['Thanks', 'for', 'helping', 'me'], 'thanks'),\n",
       " (['How', 'you', 'could', 'help', 'me', '?'], 'options'),\n",
       " (['What', 'you', 'can', 'do', '?'], 'options'),\n",
       " (['What', 'help', 'you', 'provide', '?'], 'options'),\n",
       " (['How', 'you', 'can', 'be', 'helpful', '?'], 'options'),\n",
       " (['What', 'support', 'is', 'offered'], 'options'),\n",
       " (['How', 'to', 'check', 'Adverse', 'drug', 'reaction', '?'], 'adverse_drug'),\n",
       " (['Open', 'adverse', 'drugs', 'module'], 'adverse_drug'),\n",
       " (['Give', 'me', 'a', 'list', 'of', 'drugs', 'causing', 'adverse', 'behavior'],\n",
       "  'adverse_drug'),\n",
       " (['List',\n",
       "   'all',\n",
       "   'drugs',\n",
       "   'suitable',\n",
       "   'for',\n",
       "   'patient',\n",
       "   'with',\n",
       "   'adverse',\n",
       "   'reaction'],\n",
       "  'adverse_drug'),\n",
       " (['Which', 'drugs', 'dont', 'have', 'adverse', 'reaction', '?'],\n",
       "  'adverse_drug'),\n",
       " (['Open', 'blood', 'pressure', 'module'], 'blood_pressure'),\n",
       " (['Task', 'related', 'to', 'blood', 'pressure'], 'blood_pressure'),\n",
       " (['Blood', 'pressure', 'data', 'entry'], 'blood_pressure'),\n",
       " (['I', 'want', 'to', 'log', 'blood', 'pressure', 'results'],\n",
       "  'blood_pressure'),\n",
       " (['Blood', 'pressure', 'data', 'management'], 'blood_pressure'),\n",
       " (['I',\n",
       "   'want',\n",
       "   'to',\n",
       "   'search',\n",
       "   'for',\n",
       "   'blood',\n",
       "   'pressure',\n",
       "   'result',\n",
       "   'history'],\n",
       "  'blood_pressure_search'),\n",
       " (['Blood', 'pressure', 'for', 'patient'], 'blood_pressure_search'),\n",
       " (['Load', 'patient', 'blood', 'pressure', 'result'], 'blood_pressure_search'),\n",
       " (['Show', 'blood', 'pressure', 'results', 'for', 'patient'],\n",
       "  'blood_pressure_search'),\n",
       " (['Find', 'blood', 'pressure', 'results', 'by', 'ID'],\n",
       "  'blood_pressure_search'),\n",
       " (['Find', 'me', 'a', 'pharmacy'], 'pharmacy_search'),\n",
       " (['Find', 'pharmacy'], 'pharmacy_search'),\n",
       " (['List', 'of', 'pharmacies', 'nearby'], 'pharmacy_search'),\n",
       " (['Locate', 'pharmacy'], 'pharmacy_search'),\n",
       " (['Search', 'pharmacy'], 'pharmacy_search'),\n",
       " (['Lookup', 'for', 'hospital'], 'hospital_search'),\n",
       " (['Searching', 'for', 'hospital', 'to', 'transfer', 'patient'],\n",
       "  'hospital_search'),\n",
       " (['I', 'want', 'to', 'search', 'hospital', 'data'], 'hospital_search'),\n",
       " (['Hospital', 'lookup', 'for', 'patient'], 'hospital_search'),\n",
       " (['Looking', 'up', 'hospital', 'details'], 'hospital_search')]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "documents"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['greeting',\n",
       " 'goodbye',\n",
       " 'thanks',\n",
       " 'options',\n",
       " 'adverse_drug',\n",
       " 'blood_pressure',\n",
       " 'blood_pressure_search',\n",
       " 'pharmacy_search',\n",
       " 'hospital_search']"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "classes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "47 documents\n"
     ]
    }
   ],
   "source": [
    "# lemmaztize and lower each word and remove duplicates\n",
    "words = [lemmatizer.lemmatize(w.lower()) for w in words if w not in ignore_words]\n",
    "words = sorted(list(set(words)))\n",
    "# sort classes\n",
    "classes = sorted(list(set(classes)))\n",
    "# documents = combination between patterns and intents\n",
    "print (len(documents), \"documents\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "9 classes ['adverse_drug', 'blood_pressure', 'blood_pressure_search', 'goodbye', 'greeting', 'hospital_search', 'options', 'pharmacy_search', 'thanks']\n",
      "88 unique lemmatized words [\"'s\", ',', 'a', 'adverse', 'all', 'anyone', 'are', 'awesome', 'be', 'behavior', 'blood', 'by', 'bye', 'can', 'causing', 'chatting', 'check', 'could', 'data', 'day', 'detail', 'do', 'dont', 'drug', 'entry', 'find', 'for', 'give', 'good', 'goodbye', 'have', 'hello', 'help', 'helpful', 'helping', 'hey', 'hi', 'history', 'hola', 'hospital', 'how', 'i', 'id', 'is', 'later', 'list', 'load', 'locate', 'log', 'looking', 'lookup', 'management', 'me', 'module', 'nearby', 'next', 'nice', 'of', 'offered', 'open', 'patient', 'pharmacy', 'pressure', 'provide', 'reaction', 'related', 'result', 'search', 'searching', 'see', 'show', 'suitable', 'support', 'task', 'thank', 'thanks', 'that', 'there', 'till', 'time', 'to', 'transfer', 'up', 'want', 'what', 'which', 'with', 'you']\n"
     ]
    }
   ],
   "source": [
    "# classes = intents\n",
    "print (len(classes), \"classes\", classes)\n",
    "# words = all words, vocabulary\n",
    "print (len(words), \"unique lemmatized words\", words)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "pickle.dump(words,open('words.pkl','wb'))\n",
    "pickle.dump(classes,open('classes.pkl','wb'))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Training data created\n"
     ]
    }
   ],
   "source": [
    "training = []\n",
    "# create an empty array for our output\n",
    "output_empty = [0] * len(classes)\n",
    "# training set, bag of words for each sentence\n",
    "for doc in documents:\n",
    "    # initialize our bag of words\n",
    "    bag = []\n",
    "    # list of tokenized words for the pattern\n",
    "    pattern_words = doc[0]\n",
    "    # lemmatize each word - create base word, in attempt to represent related words\n",
    "    pattern_words = [lemmatizer.lemmatize(word.lower()) for word in pattern_words]\n",
    "    # create our bag of words array with 1, if word match found in current pattern\n",
    "    for w in words:\n",
    "        bag.append(1) if w in pattern_words else bag.append(0)\n",
    "    \n",
    "    # output is a '0' for each tag and '1' for current tag (for each pattern)\n",
    "    output_row = list(output_empty)\n",
    "    output_row[classes.index(doc[1])] = 1\n",
    "    \n",
    "    training.append([bag, output_row])\n",
    "# shuffle our features and turn into np.array\n",
    "random.shuffle(training)\n",
    "training = np.array(training)\n",
    "# create train and test lists. X - patterns, Y - intents\n",
    "train_x = list(training[:,0])\n",
    "train_y = list(training[:,1])\n",
    "print(\"Training data created\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "WARNING:tensorflow:From C:\\Users\\asus\\anaconda3\\lib\\site-packages\\tensorflow\\python\\ops\\resource_variable_ops.py:435: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Colocations handled automatically by placer.\n",
      "WARNING:tensorflow:From C:\\Users\\asus\\anaconda3\\lib\\site-packages\\tensorflow\\python\\ops\\math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use tf.cast instead.\n",
      "Epoch 1/200\n",
      "47/47 [==============================] - 1s 11ms/step - loss: 2.2352 - accuracy: 0.1277\n",
      "Epoch 2/200\n",
      "47/47 [==============================] - 0s 702us/step - loss: 2.1396 - accuracy: 0.1915\n",
      "Epoch 3/200\n",
      "47/47 [==============================] - 0s 638us/step - loss: 2.0743 - accuracy: 0.2766\n",
      "Epoch 4/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 2.0282 - accuracy: 0.3404\n",
      "Epoch 5/200\n",
      "47/47 [==============================] - 0s 574us/step - loss: 1.9259 - accuracy: 0.3617\n",
      "Epoch 6/200\n",
      "47/47 [==============================] - 0s 595us/step - loss: 1.7230 - accuracy: 0.5106\n",
      "Epoch 7/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 1.7346 - accuracy: 0.3830\n",
      "Epoch 8/200\n",
      "47/47 [==============================] - 0s 553us/step - loss: 1.4757 - accuracy: 0.5957\n",
      "Epoch 9/200\n",
      "47/47 [==============================] - 0s 660us/step - loss: 1.3352 - accuracy: 0.7447\n",
      "Epoch 10/200\n",
      "47/47 [==============================] - 0s 575us/step - loss: 1.3864 - accuracy: 0.6170\n",
      "Epoch 11/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 1.1118 - accuracy: 0.7872\n",
      "Epoch 12/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 1.1073 - accuracy: 0.6596\n",
      "Epoch 13/200\n",
      "47/47 [==============================] - 0s 553us/step - loss: 0.9220 - accuracy: 0.7447\n",
      "Epoch 14/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.8244 - accuracy: 0.7872\n",
      "Epoch 15/200\n",
      "47/47 [==============================] - 0s 660us/step - loss: 0.5500 - accuracy: 0.8936\n",
      "Epoch 16/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.6465 - accuracy: 0.8085\n",
      "Epoch 17/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.5622 - accuracy: 0.8936\n",
      "Epoch 18/200\n",
      "47/47 [==============================] - 0s 532us/step - loss: 0.5814 - accuracy: 0.8511\n",
      "Epoch 19/200\n",
      "47/47 [==============================] - 0s 681us/step - loss: 0.5521 - accuracy: 0.8723\n",
      "Epoch 20/200\n",
      "47/47 [==============================] - 0s 532us/step - loss: 0.8488 - accuracy: 0.7234\n",
      "Epoch 21/200\n",
      "47/47 [==============================] - 0s 532us/step - loss: 0.4355 - accuracy: 0.9149\n",
      "Epoch 22/200\n",
      "47/47 [==============================] - 0s 553us/step - loss: 0.4545 - accuracy: 0.8511\n",
      "Epoch 23/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.4416 - accuracy: 0.8723\n",
      "Epoch 24/200\n",
      "47/47 [==============================] - 0s 659us/step - loss: 0.3450 - accuracy: 0.8936\n",
      "Epoch 25/200\n",
      "47/47 [==============================] - 0s 638us/step - loss: 0.3874 - accuracy: 0.9149\n",
      "Epoch 26/200\n",
      "47/47 [==============================] - 0s 723us/step - loss: 0.4568 - accuracy: 0.8511\n",
      "Epoch 27/200\n",
      "47/47 [==============================] - 0s 702us/step - loss: 0.3195 - accuracy: 0.9362\n",
      "Epoch 28/200\n",
      "47/47 [==============================] - 0s 511us/step - loss: 0.2567 - accuracy: 0.9362\n",
      "Epoch 29/200\n",
      "47/47 [==============================] - 0s 553us/step - loss: 0.2985 - accuracy: 0.9362\n",
      "Epoch 30/200\n",
      "47/47 [==============================] - 0s 639us/step - loss: 0.2339 - accuracy: 0.9149\n",
      "Epoch 31/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.3671 - accuracy: 0.8511\n",
      "Epoch 32/200\n",
      "47/47 [==============================] - 0s 612us/step - loss: 0.2285 - accuracy: 0.9149\n",
      "Epoch 33/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.1864 - accuracy: 0.9574\n",
      "Epoch 34/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.2104 - accuracy: 0.9362\n",
      "Epoch 35/200\n",
      "47/47 [==============================] - 0s 659us/step - loss: 0.2344 - accuracy: 0.9574\n",
      "Epoch 36/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.1705 - accuracy: 1.0000\n",
      "Epoch 37/200\n",
      "47/47 [==============================] - 0s 532us/step - loss: 0.3191 - accuracy: 0.8511\n",
      "Epoch 38/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.1495 - accuracy: 1.0000\n",
      "Epoch 39/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.1910 - accuracy: 0.9362\n",
      "Epoch 40/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.1934 - accuracy: 0.9362\n",
      "Epoch 41/200\n",
      "47/47 [==============================] - 0s 575us/step - loss: 0.1843 - accuracy: 0.9787\n",
      "Epoch 42/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.1372 - accuracy: 1.0000\n",
      "Epoch 43/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0900 - accuracy: 0.9787\n",
      "Epoch 44/200\n",
      "47/47 [==============================] - 0s 659us/step - loss: 0.1591 - accuracy: 0.9574\n",
      "Epoch 45/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.1040 - accuracy: 1.0000\n",
      "Epoch 46/200\n",
      "47/47 [==============================] - 0s 574us/step - loss: 0.0783 - accuracy: 1.0000\n",
      "Epoch 47/200\n",
      "47/47 [==============================] - 0s 575us/step - loss: 0.1588 - accuracy: 0.9787\n",
      "Epoch 48/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.1464 - accuracy: 0.9787\n",
      "Epoch 49/200\n",
      "47/47 [==============================] - 0s 574us/step - loss: 0.0650 - accuracy: 1.0000\n",
      "Epoch 50/200\n",
      "47/47 [==============================] - 0s 660us/step - loss: 0.0607 - accuracy: 0.9787\n",
      "Epoch 51/200\n",
      "47/47 [==============================] - 0s 532us/step - loss: 0.1037 - accuracy: 0.9574\n",
      "Epoch 52/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0735 - accuracy: 0.9787\n",
      "Epoch 53/200\n",
      "47/47 [==============================] - 0s 574us/step - loss: 0.0543 - accuracy: 0.9787\n",
      "Epoch 54/200\n",
      "47/47 [==============================] - 0s 511us/step - loss: 0.1610 - accuracy: 0.9362\n",
      "Epoch 55/200\n",
      "47/47 [==============================] - 0s 511us/step - loss: 0.1347 - accuracy: 0.9574\n",
      "Epoch 56/200\n",
      "47/47 [==============================] - 0s 511us/step - loss: 0.0726 - accuracy: 1.0000\n",
      "Epoch 57/200\n",
      "47/47 [==============================] - 0s 510us/step - loss: 0.0971 - accuracy: 0.9787\n",
      "Epoch 58/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.1092 - accuracy: 0.9574\n",
      "Epoch 59/200\n",
      "47/47 [==============================] - 0s 575us/step - loss: 0.1081 - accuracy: 0.9787\n",
      "Epoch 60/200\n",
      "47/47 [==============================] - 0s 574us/step - loss: 0.1125 - accuracy: 0.9574\n",
      "Epoch 61/200\n",
      "47/47 [==============================] - 0s 489us/step - loss: 0.1364 - accuracy: 0.9787\n",
      "Epoch 62/200\n",
      "47/47 [==============================] - 0s 574us/step - loss: 0.1422 - accuracy: 0.9574\n",
      "Epoch 63/200\n",
      "47/47 [==============================] - 0s 681us/step - loss: 0.0820 - accuracy: 1.0000\n",
      "Epoch 64/200\n",
      "47/47 [==============================] - 0s 489us/step - loss: 0.1012 - accuracy: 0.9574\n",
      "Epoch 65/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0551 - accuracy: 1.0000\n",
      "Epoch 66/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.1343 - accuracy: 0.9574\n",
      "Epoch 67/200\n",
      "47/47 [==============================] - 0s 595us/step - loss: 0.1388 - accuracy: 0.9574\n",
      "Epoch 68/200\n",
      "47/47 [==============================] - 0s 639us/step - loss: 0.0435 - accuracy: 1.0000\n",
      "Epoch 69/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0886 - accuracy: 0.9574\n",
      "Epoch 70/200\n",
      "47/47 [==============================] - 0s 681us/step - loss: 0.0920 - accuracy: 0.9787\n",
      "Epoch 71/200\n",
      "47/47 [==============================] - 0s 723us/step - loss: 0.0582 - accuracy: 1.0000\n",
      "Epoch 72/200\n",
      "47/47 [==============================] - 0s 787us/step - loss: 0.0426 - accuracy: 1.0000\n",
      "Epoch 73/200\n",
      "47/47 [==============================] - 0s 638us/step - loss: 0.0374 - accuracy: 1.0000\n",
      "Epoch 74/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0811 - accuracy: 0.9787\n",
      "Epoch 75/200\n",
      "47/47 [==============================] - 0s 681us/step - loss: 0.0401 - accuracy: 0.9787\n",
      "Epoch 76/200\n",
      "47/47 [==============================] - 0s 660us/step - loss: 0.0511 - accuracy: 0.9787\n",
      "Epoch 77/200\n",
      "47/47 [==============================] - 0s 766us/step - loss: 0.0416 - accuracy: 0.9787\n",
      "Epoch 78/200\n",
      "47/47 [==============================] - 0s 745us/step - loss: 0.0938 - accuracy: 0.9787\n",
      "Epoch 79/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0133 - accuracy: 1.0000\n",
      "Epoch 80/200\n",
      "47/47 [==============================] - 0s 575us/step - loss: 0.0693 - accuracy: 1.0000\n",
      "Epoch 81/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.1213 - accuracy: 0.9787\n",
      "Epoch 82/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0400 - accuracy: 1.0000\n",
      "Epoch 83/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0705 - accuracy: 0.9574\n",
      "Epoch 84/200\n",
      "47/47 [==============================] - 0s 575us/step - loss: 0.0400 - accuracy: 0.9787\n",
      "Epoch 85/200\n",
      "47/47 [==============================] - 0s 639us/step - loss: 0.0659 - accuracy: 0.9787\n",
      "Epoch 86/200\n",
      "47/47 [==============================] - 0s 638us/step - loss: 0.0395 - accuracy: 1.0000\n",
      "Epoch 87/200\n",
      "47/47 [==============================] - 0s 660us/step - loss: 0.1442 - accuracy: 0.9574\n",
      "Epoch 88/200\n",
      "47/47 [==============================] - 0s 553us/step - loss: 0.0197 - accuracy: 1.0000\n",
      "Epoch 89/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0153 - accuracy: 1.0000\n",
      "Epoch 90/200\n",
      "47/47 [==============================] - 0s 660us/step - loss: 0.0159 - accuracy: 1.0000\n",
      "Epoch 91/200\n",
      "47/47 [==============================] - 0s 575us/step - loss: 0.0235 - accuracy: 1.0000\n",
      "Epoch 92/200\n",
      "47/47 [==============================] - 0s 681us/step - loss: 0.0230 - accuracy: 1.0000\n",
      "Epoch 93/200\n",
      "47/47 [==============================] - 0s 638us/step - loss: 0.1104 - accuracy: 0.9574\n",
      "Epoch 94/200\n",
      "47/47 [==============================] - 0s 447us/step - loss: 0.0238 - accuracy: 1.0000\n",
      "Epoch 95/200\n",
      "47/47 [==============================] - 0s 575us/step - loss: 0.0959 - accuracy: 0.9787\n",
      "Epoch 96/200\n",
      "47/47 [==============================] - 0s 681us/step - loss: 0.0179 - accuracy: 1.0000\n",
      "Epoch 97/200\n",
      "47/47 [==============================] - 0s 660us/step - loss: 0.0783 - accuracy: 0.9787\n",
      "Epoch 98/200\n",
      "47/47 [==============================] - 0s 489us/step - loss: 0.0546 - accuracy: 1.0000\n",
      "Epoch 99/200\n",
      "47/47 [==============================] - 0s 554us/step - loss: 0.0156 - accuracy: 1.0000\n",
      "Epoch 100/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0658 - accuracy: 1.0000\n",
      "Epoch 101/200\n",
      "47/47 [==============================] - 0s 638us/step - loss: 0.0684 - accuracy: 0.9787\n",
      "Epoch 102/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0462 - accuracy: 0.9787\n",
      "Epoch 103/200\n",
      "47/47 [==============================] - 0s 574us/step - loss: 0.0285 - accuracy: 1.0000\n",
      "Epoch 104/200\n",
      "47/47 [==============================] - 0s 575us/step - loss: 0.0404 - accuracy: 1.0000\n",
      "Epoch 105/200\n",
      "47/47 [==============================] - 0s 574us/step - loss: 0.0237 - accuracy: 1.0000\n",
      "Epoch 106/200\n",
      "47/47 [==============================] - 0s 554us/step - loss: 0.0086 - accuracy: 1.0000\n",
      "Epoch 107/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0208 - accuracy: 1.0000\n",
      "Epoch 108/200\n",
      "47/47 [==============================] - 0s 511us/step - loss: 0.0247 - accuracy: 1.0000\n",
      "Epoch 109/200\n",
      "47/47 [==============================] - 0s 553us/step - loss: 0.0259 - accuracy: 1.0000\n",
      "Epoch 110/200\n",
      "47/47 [==============================] - 0s 553us/step - loss: 0.0210 - accuracy: 1.0000\n",
      "Epoch 111/200\n",
      "47/47 [==============================] - 0s 532us/step - loss: 0.0301 - accuracy: 1.0000\n",
      "Epoch 112/200\n",
      "47/47 [==============================] - 0s 487us/step - loss: 0.0525 - accuracy: 1.0000\n",
      "Epoch 113/200\n",
      "47/47 [==============================] - 0s 532us/step - loss: 0.0347 - accuracy: 1.0000\n",
      "Epoch 114/200\n",
      "47/47 [==============================] - 0s 553us/step - loss: 0.0268 - accuracy: 1.0000\n",
      "Epoch 115/200\n",
      "47/47 [==============================] - 0s 553us/step - loss: 0.0648 - accuracy: 0.9787\n",
      "Epoch 116/200\n",
      "47/47 [==============================] - 0s 575us/step - loss: 0.0131 - accuracy: 1.0000\n",
      "Epoch 117/200\n",
      "47/47 [==============================] - 0s 532us/step - loss: 0.0278 - accuracy: 1.0000\n",
      "Epoch 118/200\n",
      "47/47 [==============================] - 0s 490us/step - loss: 0.0132 - accuracy: 1.0000\n",
      "Epoch 119/200\n",
      "47/47 [==============================] - 0s 553us/step - loss: 0.0182 - accuracy: 1.0000\n",
      "Epoch 120/200\n",
      "47/47 [==============================] - 0s 574us/step - loss: 0.0106 - accuracy: 1.0000\n",
      "Epoch 121/200\n",
      "47/47 [==============================] - 0s 626us/step - loss: 0.0263 - accuracy: 1.0000\n",
      "Epoch 122/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0117 - accuracy: 1.0000\n",
      "Epoch 123/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0030 - accuracy: 1.0000\n",
      "Epoch 124/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0136 - accuracy: 1.0000\n",
      "Epoch 125/200\n",
      "47/47 [==============================] - 0s 553us/step - loss: 0.0108 - accuracy: 1.0000\n",
      "Epoch 126/200\n",
      "47/47 [==============================] - 0s 532us/step - loss: 0.0822 - accuracy: 0.9574\n",
      "Epoch 127/200\n",
      "47/47 [==============================] - 0s 553us/step - loss: 0.0689 - accuracy: 0.9787\n",
      "Epoch 128/200\n",
      "47/47 [==============================] - 0s 553us/step - loss: 0.0210 - accuracy: 1.0000\n",
      "Epoch 129/200\n",
      "47/47 [==============================] - 0s 553us/step - loss: 0.0244 - accuracy: 1.0000\n",
      "Epoch 130/200\n",
      "47/47 [==============================] - 0s 553us/step - loss: 0.0609 - accuracy: 0.9787\n",
      "Epoch 131/200\n",
      "47/47 [==============================] - 0s 532us/step - loss: 0.0808 - accuracy: 0.9787\n",
      "Epoch 132/200\n",
      "47/47 [==============================] - 0s 574us/step - loss: 0.0208 - accuracy: 1.0000\n",
      "Epoch 133/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0130 - accuracy: 1.0000\n",
      "Epoch 134/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0268 - accuracy: 1.0000\n",
      "Epoch 135/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0053 - accuracy: 1.0000\n",
      "Epoch 136/200\n",
      "47/47 [==============================] - 0s 574us/step - loss: 0.0041 - accuracy: 1.0000\n",
      "Epoch 137/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0236 - accuracy: 1.0000\n",
      "Epoch 138/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0643 - accuracy: 0.9787\n",
      "Epoch 139/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0549 - accuracy: 1.0000\n",
      "Epoch 140/200\n",
      "47/47 [==============================] - 0s 830us/step - loss: 0.0185 - accuracy: 1.0000\n",
      "Epoch 141/200\n",
      "47/47 [==============================] - 0s 681us/step - loss: 0.0734 - accuracy: 0.9787\n",
      "Epoch 142/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0132 - accuracy: 1.0000\n",
      "Epoch 143/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0634 - accuracy: 0.9787\n",
      "Epoch 144/200\n",
      "47/47 [==============================] - 0s 615us/step - loss: 0.0306 - accuracy: 1.0000\n",
      "Epoch 145/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0042 - accuracy: 1.0000\n",
      "Epoch 146/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0103 - accuracy: 1.0000\n",
      "Epoch 147/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0292 - accuracy: 1.0000\n",
      "Epoch 148/200\n",
      "47/47 [==============================] - 0s 510us/step - loss: 0.0110 - accuracy: 1.0000\n",
      "Epoch 149/200\n",
      "47/47 [==============================] - 0s 532us/step - loss: 0.0627 - accuracy: 0.9574\n",
      "Epoch 150/200\n",
      "47/47 [==============================] - 0s 618us/step - loss: 0.0102 - accuracy: 1.0000\n",
      "Epoch 151/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0240 - accuracy: 1.0000\n",
      "Epoch 152/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0336 - accuracy: 0.9787\n",
      "Epoch 153/200\n",
      "47/47 [==============================] - 0s 830us/step - loss: 0.0273 - accuracy: 1.0000\n",
      "Epoch 154/200\n",
      "47/47 [==============================] - 0s 766us/step - loss: 0.0328 - accuracy: 0.9787\n",
      "Epoch 155/200\n",
      "47/47 [==============================] - 0s 830us/step - loss: 0.0065 - accuracy: 1.0000\n",
      "Epoch 156/200\n",
      "47/47 [==============================] - 0s 638us/step - loss: 0.0428 - accuracy: 0.9787\n",
      "Epoch 157/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0136 - accuracy: 1.0000\n",
      "Epoch 158/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0533 - accuracy: 0.9787\n",
      "Epoch 159/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0401 - accuracy: 1.0000\n",
      "Epoch 160/200\n",
      "47/47 [==============================] - 0s 489us/step - loss: 0.0224 - accuracy: 1.0000\n",
      "Epoch 161/200\n",
      "47/47 [==============================] - 0s 553us/step - loss: 0.0179 - accuracy: 1.0000\n",
      "Epoch 162/200\n",
      "47/47 [==============================] - 0s 574us/step - loss: 0.0450 - accuracy: 0.9787\n",
      "Epoch 163/200\n",
      "47/47 [==============================] - 0s 575us/step - loss: 0.0058 - accuracy: 1.0000\n",
      "Epoch 164/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0199 - accuracy: 1.0000\n",
      "Epoch 165/200\n",
      "47/47 [==============================] - 0s 610us/step - loss: 0.0140 - accuracy: 1.0000\n",
      "Epoch 166/200\n",
      "47/47 [==============================] - 0s 511us/step - loss: 0.0395 - accuracy: 1.0000\n",
      "Epoch 167/200\n",
      "47/47 [==============================] - 0s 532us/step - loss: 0.0541 - accuracy: 0.9787\n",
      "Epoch 168/200\n",
      "47/47 [==============================] - 0s 553us/step - loss: 0.0133 - accuracy: 1.0000\n",
      "Epoch 169/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0055 - accuracy: 1.0000\n",
      "Epoch 170/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0345 - accuracy: 1.0000\n",
      "Epoch 171/200\n",
      "47/47 [==============================] - 0s 532us/step - loss: 0.0850 - accuracy: 0.9787\n",
      "Epoch 172/200\n",
      "47/47 [==============================] - 0s 532us/step - loss: 0.0056 - accuracy: 1.0000\n",
      "Epoch 173/200\n",
      "47/47 [==============================] - 0s 659us/step - loss: 0.0070 - accuracy: 1.0000\n",
      "Epoch 174/200\n",
      "47/47 [==============================] - 0s 574us/step - loss: 0.0218 - accuracy: 0.9787\n",
      "Epoch 175/200\n",
      "47/47 [==============================] - 0s 574us/step - loss: 0.0185 - accuracy: 1.0000\n",
      "Epoch 176/200\n",
      "47/47 [==============================] - 0s 574us/step - loss: 0.0347 - accuracy: 0.9787\n",
      "Epoch 177/200\n",
      "47/47 [==============================] - 0s 574us/step - loss: 0.0221 - accuracy: 1.0000\n",
      "Epoch 178/200\n",
      "47/47 [==============================] - 0s 574us/step - loss: 0.0046 - accuracy: 1.0000\n",
      "Epoch 179/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0254 - accuracy: 0.9787\n",
      "Epoch 180/200\n",
      "47/47 [==============================] - 0s 638us/step - loss: 0.0104 - accuracy: 1.0000\n",
      "Epoch 181/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0718 - accuracy: 0.9787\n",
      "Epoch 182/200\n",
      "47/47 [==============================] - 0s 723us/step - loss: 0.0727 - accuracy: 0.9574\n",
      "Epoch 183/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0351 - accuracy: 0.9787\n",
      "Epoch 184/200\n",
      "47/47 [==============================] - 0s 659us/step - loss: 0.0132 - accuracy: 1.0000\n",
      "Epoch 185/200\n",
      "47/47 [==============================] - 0s 638us/step - loss: 0.0182 - accuracy: 1.0000\n",
      "Epoch 186/200\n",
      "47/47 [==============================] - 0s 660us/step - loss: 0.0123 - accuracy: 1.0000\n",
      "Epoch 187/200\n",
      "47/47 [==============================] - 0s 660us/step - loss: 0.0055 - accuracy: 1.0000\n",
      "Epoch 188/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0064 - accuracy: 1.0000\n",
      "Epoch 189/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0140 - accuracy: 1.0000\n",
      "Epoch 190/200\n",
      "47/47 [==============================] - 0s 574us/step - loss: 0.0211 - accuracy: 1.0000\n",
      "Epoch 191/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0125 - accuracy: 1.0000\n",
      "Epoch 192/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0067 - accuracy: 1.0000\n",
      "Epoch 193/200\n",
      "47/47 [==============================] - 0s 575us/step - loss: 0.0153 - accuracy: 1.0000\n",
      "Epoch 194/200\n",
      "47/47 [==============================] - 0s 574us/step - loss: 0.0164 - accuracy: 1.0000\n",
      "Epoch 195/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0779 - accuracy: 0.9787\n",
      "Epoch 196/200\n",
      "47/47 [==============================] - 0s 617us/step - loss: 0.0259 - accuracy: 0.9787\n",
      "Epoch 197/200\n",
      "47/47 [==============================] - 0s 596us/step - loss: 0.0180 - accuracy: 1.0000\n",
      "Epoch 198/200\n",
      "47/47 [==============================] - 0s 639us/step - loss: 0.0137 - accuracy: 1.0000\n",
      "Epoch 199/200\n",
      "47/47 [==============================] - 0s 595us/step - loss: 0.0921 - accuracy: 0.9787\n",
      "Epoch 200/200\n",
      "47/47 [==============================] - 0s 660us/step - loss: 0.0086 - accuracy: 1.0000\n"
     ]
    }
   ],
   "source": [
    "model = Sequential()\n",
    "model.add(Dense(128, input_shape=(len(train_x[0]),), activation='relu'))\n",
    "model.add(Dropout(0.5))\n",
    "model.add(Dense(64, activation='relu'))\n",
    "model.add(Dropout(0.5))\n",
    "model.add(Dense(len(train_y[0]), activation='softmax'))\n",
    "\n",
    "# Compile model. Stochastic gradient descent with Nesterov accelerated gradient gives good results for this model\n",
    "sgd = SGD(lr=0.01, decay=1e-6, momentum=0.9, nesterov=True)\n",
    "model.compile(loss='categorical_crossentropy', optimizer=sgd, metrics=['accuracy'])\n",
    "\n",
    "#fitting and saving the model \n",
    "hist = model.fit(np.array(train_x), np.array(train_y), epochs=200, batch_size=5, verbose=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "model created\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "os.chdir(r'D:\\internship\\chatbot-master')\n",
    "model.save('chatbot_model.h5', hist)\n",
    "\n",
    "print(\"model created\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
